package com.tensquare.recruit.controller;

import com.tensquare.recruit.pojo.Enterprise;
import com.tensquare.recruit.pojo.Recruit;
import com.tensquare.recruit.service.EnterpriseService;
import com.tensquare.recruit.service.RecruitService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * & ProjectName：  tensquare-parent
 * & PackageName:   com.tensquare.recruit.controller
 * & Creation_Date： 2020/3/31 00:03
 * & Author：しの
 * ----------------------------------
 * & Description:
 */
@RestController
@RequestMapping("/recruit")
public class RecruitController {
    @Autowired
    private RecruitService recruitService;

    //1 查询推荐职位列表
    @GetMapping("/search/recommend")
    public Result recommend() {
        List<Recruit> recruitList = recruitService.recommend();
        return new Result(true, StatusCode.OK, "推荐职位列表查询成功", recruitList);
    }

    //2 查询最新职位
    @GetMapping("/search/newlist")
    public Result newlist() {
        List<Recruit> recruitList = recruitService.newlist();
        return new Result(true, StatusCode.OK, "最新职位列表查询成功", recruitList);
    }
}
